#include <bits/stdc++.h>
using namespace std;
#define int long long
int n,m,k,T;

signed main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin >> n >> m >> k;
	int ans = 0;
	for(int i = 0;i < k; ++ i) {
		int x,y;
		cin >> x >> y;
		if(y >= x) ans++;
	} 
	cout << ans << endl;
	return 0;
}